package com.lantosec.hmrp.modules.sysdata.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.sysdata.vo.SysDataFormExtVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * <p>
 * 表单扩展字段 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-03-02
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SysDataFormExt extends BaseEntity<SysDataFormExtVO> {

    private static final long serialVersionUID = 1L;
    /**
     * 主键
     */
    @TableId(value = "data_form_ext_id", type = IdType.ASSIGN_UUID)
    private String dataFormExtId;
    /**
     * 表单ID
     */
    private String dataFormId;

    @Override
    public SysDataFormExtVO convertToVO() {
        return new SysDataFormExtVO(this);
    }

    /**
     * 字段名
     */
    private String fieldName;
    /**
     * 字段类型
     */
    private String fieldType;

    public SysDataFormExt(SysDataFormExtVO vo) {
        this.dataFormExtId = vo.getDataFormExtId();
        this.dataFormId = vo.getDataFormId();
        this.fieldName = vo.getFieldName();
        this.fieldType = vo.getFieldType();
        this.comment = vo.getComment();
    }

    /**
     * 字段注释
     */
    private String comment;


    public enum ColName {
        data_form_ext_id, data_form_id, field_name, field_type, comment,
    }
}
